import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import manager from '@/components/manager/loginManager'
import index from '@/components/manager/index'
import welcome from '@/components/manager/welcome'
import user from '@/components/manager/user'
import shop from '@/components/manager/adminshop'
import dashboard from '@/components/manager/dashboard'
import BarGraph from '@/components/manager/component/bargraph'
import PieGraph from '@/components/manager/component/piegraph'
import app from '@/components/app/app'
import all from '@/components/app/all'
import cart from '@/components/app/cart'
import me from '@/components/app/me'
import login from '@/components/app/login'
import productde from '@/components/app/productde'



Vue.use(Router)

export default new Router({
  mode:'history',
  routes: [
    {
      path: '/',
      component: HelloWorld
    },
    {
      path: '/manager',
      name:"manager",
      component: manager
    },
    {
      path: '/index',
      name:"index",
      component: index,
      children: [
        {
          path:'welcome',
          component: welcome
        },
        {
          path:'user',
          component: user
        },
        {
          path:'shop',
          component: shop
        },
        {
          path:'dashboard',
          component: dashboard,
          children: [
            {
              path:'BarGraph',
              component: BarGraph
            },
            {
              path:'PieGraph',
              component: PieGraph
            }
          ]
        }
      ]
    },
    {
      path: '/app',
      name:"app",
      component: app,
      meta: {
        requiresAuth: true,
        showTab:true
       }
    },
    {
      path: '/all',
      name:"all",
      component: all,
      meta: {
        requiresAuth: true,
        showTab:true
       }
    },
    {
      path: '/me',
      name:"me",
      component: me,
      meta: {
        requiresAuth: true,
        showTab:true
       }
    },
    {
      path: '/cart',
      name:"cart",
      component: cart,
      meta: {
        requiresAuth: true,
        showTab:true
       }
    },
    {
      path: '/login',
      name:"login",
      component: login
    },
    {
      path: '/describe',
      name: 'Describe',
      component: productde,
      meta: {
        requiresAuth: true,
       }
    }
  ]
})
